package edu.pku.sei.modeler.actions.registry;

import java.util.List;

import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.ui.actions.ActionGroup;

public abstract class TreeViewActionGroup extends ActionGroup {
	private TreeViewer tv;
	public TreeViewActionGroup(TreeViewer tv) {
		this.tv = tv;
	}
	
	@Override
	abstract public void fillContextMenu(IMenuManager menu);
	
	protected List getSelection() {
		return ((TreeSelection)tv.getSelection()).toList();
	}
	
	protected TreeViewer getTreeViewer() {
		return tv;
	}

}
